package com.rockwell.maze800.model;

import net.wimpi.modbus.ModbusException;

public interface IRobotSensors {
	
	public static final int LEFT_DISTANCE_SENSOR_REF = 1;
	public static final int RIGHT_DISTANCE_SENSOR_REF = 2;
	public static final int SENSORS_STATUS_REF = 3;
	
	public static final short FRONT_SENSOR_MASK = 0x1;
	public static final short LEFT_SENSOR_MASK = 0x1 << 1;
	public static final short RIGHT_SENSOR_MASK = 0x1 << 2;
	public static final short ARM_DOWN_SENSOR_MASK = 0x1 << 3;
	public static final short ARM_UP_SENSOR_MASK = 0x1 << 4;
	
	/**
	 * Detects if the robot has a distance sensor at the left side.
	 * @return
	 */
	boolean hasLeftDistanceSensor();
	
	/**
	 * Detects if the robot has a distance sensor at the front side.
	 * @return
	 */
	boolean hasFrontDistanceSensor();
	
	/**
	 * Detects if the robot has a distance sensor at the right side.
	 * @return
	 */
	boolean hasRightDistanceSensor();
	
	double getLeftDistance();
	double getRightDistance();
	boolean getFrontStatus();
	boolean detectLeftWall();
	boolean detectRightWall();
	boolean detectFrontWall();
	int[] getAllSensorStatus();
	
	/**
	 * Get the orientation of the vehicle.
	 * @return the orientation in degree
	 */
	float getOrientation();
	void setOrientation(float angle);

	boolean isArmUp();
	boolean isArmDown();
}
